package br.com.felix.fwt.ui;

import java.io.PrintWriter;

import br.com.felix.fwt.ui.exception.ComponentRenderException;

public class UnorderedList extends BaseComponent {

	@Override
	public void write(PrintWriter out) throws ComponentRenderException {
		if (getPresentationMode()!= PresentationMode.INVISIBLE){
			out.write("<ul");
			if (this.getName() != null) {
				out.write(" id=\"");
				out.write(this.getName());
				out.write("\"");
			}
			out.write(">\n");
			for (BaseComponent child: childs)
			{
				out.write("\t<li");
				if (child.getName()!=null){
					out.write(" id=\"");
					out.write(child.getName());
					out.write("\"");
				}
				out.write(">\n");
				child.write(out);
				out.write("</li>");
			}
			out.write("</ul>");
		}
	}

	
	{
		setPresentationMode(PresentationMode.SHOW);		
	}

}
